<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php

	require_once("../connectMysql/connetMysql.class.php");
	session_start();
	$UserPhone=$_SESSION['mb'];
	
	$db=new connetMysql;
	$con=$db->getConnect();
	$get_idsql="SELECT UserId FROM user WHERE UserPhone='".$UserPhone."'";
	
	$result=$con->query($get_idsql);
	$row = mysqli_fetch_assoc($result);
	$Userid=$row['UserId'];
	
	$petname=$_POST['petname'];
	$usersex=$_POST['usersex'];
	$opencontact=$_POST['opencontact'];
	$title=$_POST['title'];//g个人描述
	$eduexper=$_POST['eduexper'];
	$usertype=$_POST['usertype'];
	$skill=$_POST['skill'];
	$userbirth=$_POST['userbirth'];
	if(empty($_POST['livprov']))
	{
		$livprov='';
	}
	else
	{
		$livprov=$_POST['livprov'];
	}
	if(empty($_POST['livcity']))
	{
		$livcity='';
	}
	else
	{
		$livcity=$_POST['livcity'];
	}
	if(empty($_POST['homeprov']))
	{
		$homeprov='';
	}
	else
	{
		$homeprov=$_POST['homeprov'];
	}
	if(empty($_POST['homecity']))
	{
		$homecity='';
	}
	else
	{
		$homecity=$_POST['homecity'];
	}
	$intro=$_POST['intro'];//工作经历
	
	date_default_timezone_set('PRC');
    $ActPublishTime=date("Y-m-d h:i:s");	
	
		$sql = "UPDATE user SET PetName='".$petname."',UserSex=".$usersex.",UserBirth='".$userbirth."',UserTypeId=".$usertype.",UserDescri='".$title." ',HomeProv='".$homeprov."',HomeCity='".$homecity."',LivProv='".$livprov."',LivCity='".$livcity."',Skill='".$skill."',OpenContact='".$opencontact."',WorkExper='".$intro."',EduExper='".$eduexper."' WHERE UserId=".$Userid;
		
		
		$result = mysqli_query($con,$sql);
		echo "<script>alert('更新成功！');</script>";
		$con->close(); 
		echo "<script>window.location.href='me.php'</script>";
		
	
?>